import { RouteRecordRaw } from "vue-router";
import { Layout } from "@/routers/constant";

// 超级表格模块
const systemRouter: Array<RouteRecordRaw> = [
	{
		path: "/system",
		component: Layout,
		redirect: "/system/user",
		meta: {
			title: "系统配置"
		},
		children: [
			{
				path: "/system/user",
				name: "systemUser",
				component: () => import("@/views/system/user/index.vue"),
				meta: {
					keepAlive: true,
					requiresAuth: true,
					title: "账号管理",
					key: "systemUser"
				}
			},
			{
				path: "/system/role",
				name: "systemRole",
				component: () => import("@/views/system/role/index.vue"),
				meta: {
					keepAlive: true,
					requiresAuth: true,
					title: "角色管理",
					key: "systemRole"
				}
			},
			{
				path: "/system/menu",
				name: "systemMenu",
				component: () => import("@/views/system/menu/index.vue"),
				meta: {
					keepAlive: true,
					requiresAuth: true,
					title: "菜单管理",
					key: "systemMenu"
				}
			},
			{
				path: "/system/freeTable",
				name: "systemFreeTable",
				component: () => import("@/views/system/freeTable/index.vue"),
				meta: {
					keepAlive: true,
					requiresAuth: true,
					title: "数据表",
					key: "systemFreeTable"
				}
			}
		]
	}
];

export default systemRouter;
